//
//  STHairHouseVC.m
//  YiYueHairdresser
//
//  Created by zhouzhouzhou on 2018/10/9.
//  Copyright © 2018年 YuYiLian. All rights reserved.
//

#import "STHairHouseVC.h"

#import "STFindDoorListVC.h"
#import "STDoorInfoVC.h"


@interface STHairHouseVC ()<STHairHouseListViewDelegate>{
    STHairHouseListView * houseListView;
    NSArray *arrHouse;
}
@end

@implementation STHairHouseVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"入驻门店";
    
    [self wr_setNavBarTintColor:[UIColor blackColor]];
    UIButton * btnShopBar =[[UIButton alloc]init];
    [btnShopBar setTitle:@"入驻" forState:UIControlStateNormal];
    [btnShopBar setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    btnShopBar.frame=CGRectMake(0, 0, 30, 30);
    [btnShopBar addTarget:self action:@selector(actionAddHairHouse) forControlEvents:UIControlEventTouchUpInside];
    self.navigationItem.rightBarButtonItem=[[UIBarButtonItem alloc]initWithCustomView:btnShopBar];
    
    self.view.backgroundColor = BgColor;
    
    [self loadMyHouseList];
    [self loadHouseListView];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)actionAddHairHouse{
    STFindDoorListVC * addHouseVC  =[STFindDoorListVC new];
    addHouseVC.hidesBottomBarWhenPushed= YES;
    [self.navigationController pushViewController:addHouseVC animated:YES];
    
}

-(void)loadMyHouseList{
//    arrHouse = @[@"",@"",@""];
    [STHairService getHairStoreUrl:^(id result, NSError *error) {
        if (result) {
            // 不做分页
            NSArray *array = [NSArray modelArrayWithClass:STHairHouseListModel.class json:result];
            [houseListView setHairHouseListView:1 data:array];
        }
    }];
}

-(void)loadHouseListView{
    houseListView = [[STHairHouseListView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
    houseListView.delegate = self;
    [houseListView setHairHouseListView:1 data:nil];
    [self.view addSubview:houseListView];
}


-(void)hairHouseListSelNum:(NSInteger)selNum;{
    STDoorInfoVC * doorInfoVC  =[STDoorInfoVC new];
    doorInfoVC.isSign = YES;
    doorInfoVC.stylistId = 1;
    doorInfoVC.hidesBottomBarWhenPushed= YES;
    [self.navigationController pushViewController:doorInfoVC animated:YES];
}

@end
